package com.eastfair.pay.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 商户系统
 * </p>
 *
 * @author clm
 * @since 2023-02-22
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("pay_merchant_system")
@ApiModel(value = "MerchantSystem", description = "商户系统")
@AllArgsConstructor
public class MerchantSystem extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 系统名称
     */
    @ApiModelProperty(value = "系统名称")
    @Size(max = 255, message = "系统名称长度不能超过255")
    @TableField(value = "system_name", condition = LIKE)
    @Excel(name = "系统名称")
    private String systemName;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Size(max = 255, message = "创建人长度不能超过255")
    @TableField(value = "creater_name", condition = LIKE)
    @Excel(name = "创建人")
    private String createrName;

    /**
     * 绑定商户名
     */
    @ApiModelProperty(value = "绑定商户名")
    @Size(max = 255, message = "绑定商户名长度不能超过255")
    @TableField(value = "bind_merchant", condition = LIKE)
    @Excel(name = "绑定商户名")
    private String bindMerchant;

    /**
     * 绑定商户名id
     */
    @ApiModelProperty(value = "绑定商户名id")
    @TableField(value = "bind_merchant_id")
    @Excel(name = "绑定商户名id")
    private Long bindMerchantId;

    /**
     * 有效开始时间
     */
    @ApiModelProperty(value = "有效开始时间")
    @TableField(value = "valid_start_time")
    @Excel(name = "有效开始时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime validStartTime;

    /**
     * 有效结束时间
     */
    @ApiModelProperty(value = "有效结束时间")
    @TableField(value = "valid_end_time")
    @Excel(name = "有效结束时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime validEndTime;

    /**
     * 有效类型(VALID_TYPE)
     */
    @ApiModelProperty(value = "有效类型(VALID_TYPE)")
    @Size(max = 255, message = "有效类型(VALID_TYPE)长度不能超过255")
    @TableField(value = "valid_type", condition = LIKE)
    @Excel(name = "有效类型(VALID_TYPE)")
    private String validType;

    /**
     * 系统标识
     */
    @ApiModelProperty(value = "系统标识")
    @Size(max = 255, message = "系统标识长度不能超过255")
    @TableField(value = "system_code", condition = LIKE)
    @Excel(name = "系统标识")
    private String systemCode;


    @Builder
    public MerchantSystem(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String systemName, String createrName, String bindMerchant, Long bindMerchantId, LocalDateTime validStartTime, LocalDateTime validEndTime, 
                    String validType, String systemCode) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.systemName = systemName;
        this.createrName = createrName;
        this.bindMerchant = bindMerchant;
        this.bindMerchantId = bindMerchantId;
        this.validStartTime = validStartTime;
        this.validEndTime = validEndTime;
        this.validType = validType;
        this.systemCode = systemCode;
    }

}
